package com.wn55.hrms.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wn55.hrms.entity.Evection;
import com.wn55.hrms.entity.OverTime;
import com.wn55.hrms.mapper.EvectionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Mr.bai~
 * @version 1.0
 * @date 2022/5/6 17:14
 */
@Service
public class EvectionService {
    
    @Autowired
    EvectionMapper evectionMapper;

    public PageInfo<Evection> queryEvection(Integer now, Integer size, String eName, String type) {
        PageHelper.startPage(now,size);
        List<Evection> list = evectionMapper.selectConds(eName,type);
        return new PageInfo<>(list);
    }

    public void removeBykey(int id) {
        evectionMapper.deleteByPrimaryKey(id);
    }

    public void addEvection(Evection evection) {
        evectionMapper.insertEvection(evection);
    }

    public void modifyEvection(Evection evection) {
        evectionMapper.updateByPrimaryKey(evection);
    }
}
